package com.andertrift.connectors;
import java.util.List;

import facebook4j.Facebook;
import facebook4j.FacebookException;
import facebook4j.FacebookFactory;
import facebook4j.Post;

public class FacebookConnector {
	
	Facebook facebook = new FacebookFactory().getInstance();
	
	public FacebookConnector() {
		FacebookFactory ff = new FacebookFactory();
		facebook = ff.getInstance();
	}
	
	public boolean postMessage(String text) throws FacebookException{
		facebook.postStatusMessage(text);
		return false;
	}
	
	public List<Post> getCommentList() throws FacebookException {
		List<Post> feed = facebook.getStatuses();
		System.out.println(feed);
		return feed;
	}
	
	public String postComment(String postId, String comment) throws FacebookException {
		return facebook.commentPost(postId, comment);
	}
	
	
	public String getPost(String postId) throws FacebookException {
		return facebook.getPost(postId).getMessage();
	}
	
	public String getMessage(String messageId) throws FacebookException {
		return facebook.getMessage(messageId).getMessage();
	}
	
}
